import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)


const router = new Router({
    // mode: 'history', //就是这里
    routes: [{
        path: '/',
        name: 'index',
        component: resolve => require(['@/components/mobile/index/index'], resolve),
        meta: {
            requiresAuth: false
        }
    },
    
    ]
})

export default router

// router.beforeEach((to, from, next) => {
//     if (to.matched.some(record => record.meta.requiresAuth)) {
//         if (!localStorage.getItem('token')) {
//             next({
//                 path: '/login',
//                 query: {
//                     redirect: to.fullPath
//                 }
//             })
//         } else {
//             next()
//         }
//     } else {
//         next() 
//     }
// })
